package com.zhongli.devplatform.mapper.sys;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ReadRoleDeviceTypeMapper {

    @Insert("insert into read_role_device_type values(#{roleId},#{deviceType})")
    void insert(@Param("roleId") Integer roleId, @Param("deviceType") String deviceType);

    @Delete("delete from read_role_device_type where role_id = #{roleId}")
    void deleteByRole(Integer roleId);

    @Select("select device_type from read_role_device_type where role_id = #{roleId}")
    List<String> listDeviceType(Integer roleId);

    @Select("select role_id from read_role_device_type where device_type = #{deviceType}")
    List<Integer> listRoleByDeviceType(String deviceType);


}
